﻿@model List<Mondial2014.Controllers.KnockoutGamblesController.KnockoutGambleViewModel>

@{
    ViewBag.Title = "הימורים";
}

<h2>עידכון הימורים עבור @Html.DisplayFor(model => model.First().GamblerName)</h2>

@Html.ActionLink("חזרה לרשימת משתתפים", "Index", "Gamblers")
<br /><br />

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">

        <table class="table">
            <tr>
                <th>
                    שמינית
                </th>
                <th>
                    רבע
                </th>
                <th>
                    חצי
                </th>
                <th>
                    גמר
                </th>
                <th>
                    זוכה
                </th>
            </tr>
            <tr>
                <td>
                    @for (var index = 0; index < 16; index++)
                    {
                        if (Model[index].Qualified)
                        {
                            <img src="~/Content/images/check.png" alt="" />
                            @Html.DisplayFor(model => Model[index].TeamName)
                            <br/>
                        }
                    }
                    @for (var index = 0; index < 16; index++)
                    {
                        if (!Model[index].Qualified)
                        {
                            @Html.DisplayFor(model => Model[index].TeamName)
                            <br />
                        }
                    }
                </td>
                <td>
                    @for (var index = 16; index < 24; index++)
                    {
                        if (Model[index].Qualified)
                        {
                            <img src="~/Content/images/check.png" alt="" />
                            @Html.DisplayFor(model => Model[index].TeamName)
                            <br />
                        }
                    }
                    @for (var index = 16; index < 24; index++)
                    {
                        if (!Model[index].Qualified)
                        {
                            @Html.DisplayFor(model => Model[index].TeamName)
                            <br />
                        }
                    }
                </td>
                <td>
                    @for (var index = 24; index < 28; index++)
                    {
                        if (Model[index].Qualified)
                        {
                            <img src="~/Content/images/check.png" alt="" />
                            @Html.DisplayFor(model => Model[index].TeamName)
                            <br />
                        }
                    }
                    @for (var index = 24; index < 28; index++)
                    {
                        if (!Model[index].Qualified)
                        {
                            @Html.DisplayFor(model => Model[index].TeamName)
                            <br />
                        }
                    }
                </td>
                <td>
                    @for (var index = 28; index < 30; index++)
                    {
                        if (Model[index].Qualified)
                        {
                            <img src="~/Content/images/check.png" alt="" />
                            @Html.DisplayFor(model => Model[index].TeamName)
                            <br />
                        }
                    }
                    @for (var index = 28; index < 30; index++)
                    {
                        if (!Model[index].Qualified)
                        {
                            @Html.DisplayFor(model => Model[index].TeamName)
                            <br />
                        }
                    }
                </td>
                <td>
                    @for (var index = 30; index < 31; index++)
                    {
                        if (Model[index].Qualified)
                        {
                            <img src="~/Content/images/check.png" alt="" />
                            @Html.DisplayFor(model => Model[index].TeamName)
                            <br />
                        }
                    }
                    @for (var index = 30; index < 31; index++)
                    {
                        if (!Model[index].Qualified)
                        {
                            @Html.DisplayFor(model => Model[index].TeamName)
                            <br />
                        }                        
                    }
                </td>
            </tr>
        </table>

    </div>
}

<div>
    <br />
    @Html.ActionLink("חזרה לרשימת משתתפים", "Index", "Gamblers")
</div>

@section Scripts 
{
    @Scripts.Render("~/bundles/jqueryval")
}
